<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>style动态绑定属性</title>
</head>

<body>
    <div class="app">
        <div :style="{border:borderStyle, width:widthStyle,height:heightStyle}">对象动态样式</div>
        <div :style="objStyles">对象动态样式简写</div>
        <div :style="[objStyles,fontStyle]">数组动态样式简写</div>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        var xm = new Vue({
            el: '.app',
            data: {
                borderStyle: '1px solid pink',
                widthStyle: '50px',
                heightStyle: '50px',
                objStyles: {
                    border: '1px solid black',
                    width: '150px',
                    height: '150px'
                },
                fontStyle: {
                    fontSize: '25px',
                    color: 'red'
                }
            },

            methods: {
            }
        })

    </script>
</body>

</html>